/**
 * Created by Administrator on 2017-3-16.
 */
import React , { Component }from 'react';
import { StyleSheet,View,Text} from 'react-native';
import {Actions, Scene, Router} from 'react-native-router-flux';
import Login from './src/pages/login/login';
import Icon from 'react-native-vector-icons/FontAwesome';
//未检车次列表
import  CheckList from './src/pages/checklist/checklist'
import Purchase from './src/pages/checklist/purchase';

import BaiduMap from './BaiduMapDemo';
class TabBar extends Component{
    constructor(props){
        super(props);
        this.data={
            home:{
                title:"首页",
                icon:"home",
            },
            scan:{
                title:"扫描",
                icon:"user",
            },
            me:{
                title:"我的",
                icon:"user",
            }
        }
    }
    render(){
        let param=this.data[this.props.sceneKey];
        let activeStyle=this.props.selected?{color:"#3399FF"}:{};
        return <View>
            <Icon name={param.icon} color={activeStyle.color} size={25}/>
            <Text style={[activeStyle,styles.tabbarItem]}>{param.title}</Text>
        </View>
    }
}

var styles=StyleSheet.create({
    tabbarContainer:{
        flex:1,
        backgroundColor:"#f6f6f6",
    },
    tabbarItem:{
        alignItems:"center",
        justifyContent:"center",
        textAlign:"center",
        marginLeft:-3
    }
})
  export  default   scenes  = Actions.create(
    <Scene key="root">
        <Scene key="login" component={Login} title="Login" initial   hideNavBar hideTabBar />
        <Scene key="mainpage"  name="tabbar" duration={0} tabs={true} style={styles.tabbarContainer}     >
            <Scene key="home" duration={0} component={CheckList} title="首页" icon={TabBar} hideNavBar />
            <Scene key="scan" duration={0} component={Purchase} title="扫描" icon={TabBar} />
            <Scene key="me" duration={0} component={BaiduMap} title="我的" icon={TabBar} />

        </Scene>
    </Scene>
);